import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int x = in.nextInt();
            int[] weight = new int[n];
            long ret = x;
            for (int i = 0; i < n; i++) {
                weight[i] = in.nextInt();
                if (ret >= weight[i]) {
                    ret += weight[i];
                } else {
                    ret += gcd(ret, weight[i]);
                }
            }
            System.out.println(ret);
        }
    }

    private static long gcd(long num1, long num2) {
        while (num2 != 0) {
            long tmp = num2;
            num2 = num1 % num2;
            num1 = tmp;
        }
        return num1;
    }
}
